class ThreatNameCompDB:
    def __init__(self):
        self.threatCompRes = {}
        self.noOfSimilarity= 0
    
    # handles the storage of Threat comparison result
    # stores on self.threatCompRes
    def add(self,threatNameList, md5a, md5b):
        md5listA = []
        md5listB = []
        threatSet = {}
        for item in threatNameList:
            if self.threatCompRes.has_key(item):
                threatSet = self.threatCompRes[item]
                md5listA = threatSet['Set A']
                md5listB = threatSet['Set B']
                self.noOfSimilarity = self.noOfSimilarity - 1
            md5listA.append(md5a)
            md5listB.append(md5b)
            md5listA = list(set(md5listA))
            md5listB = list(set(md5listB))
            threatSet['Set A'] = md5listA
            threatSet['Set B'] = md5listB
            self.threatCompRes[item] = threatSet
            self.noOfSimilarity = self.noOfSimilarity + 1